﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using ShakeIt_.ServiceReference2;

namespace ShakeIt_
{
    public partial class infoPage : PhoneApplicationPage
    {
        public infoPage()
        {
            InitializeComponent();
            displayUser(Data.currentUser);
            Data.proxy.FindUserCompleted += new EventHandler<FindUserCompletedEventArgs>(proxy_FindUser);
        }

        private void ApplicationBarIconButton_Click(object sender, EventArgs e)
        {
            this.NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
        }

        private void proxy_FindUser(object sender, FindUserCompletedEventArgs e)
        {
            displayUser(Data.currentUser);
        }

        private void displayUser(_User usr)
        {
            usrName.Text += " " + usr.username;
            phonenumber.Text += " " + usr.cellPhone;
        }
    }
}